package com.mhs.pb.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Records entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "record", catalog = "PersonalRelation")
public class Record implements BaseEntity {

private static final long serialVersionUID = -2600644981581057766L;
// Fields

private Long id;
private Relation relation;
private String type;
private Date startdate;
private Date enddate;
private String accomplishment;
private String description;

// Constructors

/** default constructor */
public Record() {
}

/** minimal constructor */
public Record(Relation relation, String type, Date startdate) {
	this.relation = relation;
	this.type = type;
	this.startdate = startdate;
}

/** full constructor */
public Record(Relation relation, String type, Date startdate, Date enddate,
		String accomplishment, String description) {
	this.relation = relation;
	this.type = type;
	this.startdate = startdate;
	this.enddate = enddate;
	this.accomplishment = accomplishment;
	this.description = description;
}

// Property accessors
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Long getId() {
	return this.id;
}

public void setId(Long id) {
	this.id = id;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "relationid", nullable = false)
public Relation getRelation() {
	return this.relation;
}

public void setRelation(Relation relation) {
	this.relation = relation;
}

@Column(name = "type", nullable = false)
public String getType() {
	return this.type;
}

public void setType(String type) {
	this.type = type;
}

@Temporal(TemporalType.DATE)
@Column(name = "startdate", nullable = false, length = 10)
public Date getStartdate() {
	return this.startdate;
}

public void setStartdate(Date startdate) {
	this.startdate = startdate;
}

@Temporal(TemporalType.DATE)
@Column(name = "enddate", length = 10)
public Date getEnddate() {
	return this.enddate;
}

public void setEnddate(Date enddate) {
	this.enddate = enddate;
}

@Column(name = "accomplishment", length = 65535)
public String getAccomplishment() {
	return this.accomplishment;
}

public void setAccomplishment(String accomplishment) {
	this.accomplishment = accomplishment;
}

@Column(name = "description", length = 65535)
public String getDescription() {
	return this.description;
}

public void setDescription(String description) {
	this.description = description;
}

}